#!/usr/bin/env python
# encoding: utf-8

from comando import AbstractValidationCommand,ComandoResult
import random

class GetTestCommand(AbstractValidationCommand):
	def required(self):
		return {'foo'}
		
	def doExecute(self):
		result = ComandoResult()
		result.setData('foo',self.getParam('foo'))
		return result

class PostTestCommand(AbstractValidationCommand):
	def required(self):
		return {'foo'}

	def doExecute(self):
		result = ComandoResult()
		result.setData('foo',self.getParam('foo'))
		return result

class RequestTestCommand(AbstractValidationCommand):
	def required(self):
		return {'foo'}

	def doExecute(self):
		result = ComandoResult()
		result.setData('foo',self.getParam('foo'))
		return result

class ScriptTestCommand(AbstractValidationCommand):

	def required(self):
		return {'foo'}

	def doExecute(self):
		result = ComandoResult()
		result.setData('foo',self.getParam('foo'))
		return result


class ExpressionTestCommand(AbstractValidationCommand):
	def required(self):
		return frozenset([])
	def optional(self):
		return frozenset([])
	def doExecute(self):
		result = ComandoResult()
		result.setStatus(1)
		return result

class RandomCommand(AbstractValidationCommand):
	def required(self):
		return frozenset([])
	def optional(self):
		return frozenset([])
	def doExecute(self):
		result = ComandoResult()
		result.setData('value',random.random())
		return result